/*  */

describe('Blog homepage', function() {
  it('should add a new entry', function() {
    // Load the AngularJS homepage.
    browser.get('/#/addEntry.html');
    var entry = {};
    // Find the element with ng-model matching 'yourName' - this will
    // find the <input type="text" ng-model="yourName"/> element - and then
    // type 'Julie' into it.
    element(by.model('title')).sendKeys('AA');
    //element(by.model('body')).sendKeys('BB');
    element(by.id('submit')).click().then(function(){


        entry.title = element.all(by.repeater('entry in entries')).findElement(by.binding('entry.title'));
        //entry.body  = element(by.repeater('entry in entries')).findElement(by.binding('entry.body'));



        expect(entry.title.getText()).toEqual('AA');
        //expect(entry.body.getText()).toEqual('BB');

   } );

    //element(by.linkName('Add Entry')).click().then();

    // Find the element with binding matching 'yourName' - this will
    // find the <h1>Hello {{yourName}}!</h1> element.
    //var greeting = element(by.binding('yourName'));

    // Assert that the text element has the expected value.
    // Protractor patches 'expect' to understand promises.


  });
});